﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Vendor/jquery-1.9.0.js"></script>
    <link href="../Vendor/jquery-ui-1.10.0.custom.css" rel="stylesheet" />
    <script src="../Vendor/jquery-ui-1.10.0.custom.js"></script>
</head>
<body>
    
    <script>
       
        $(document).ready(function () {
            $("#startBtn").on('click', function () {
                var requiredNumber = 10000,
                    i,
                    $button,
                    $container = $("#container");


                var createBatchOfButtons = function ($container, i, requiredNumber) {
                }


                var addButton = function ($container, text) {

                    setTimeout(function () {
                        $button = $("<div />");
                        $button.appendTo($container);
                        $button.button({
                            label: text
                        });
                        $button.click(function () {
                            alert(text);
                        });
                    }, 25);
                }

                for (i = 0; i < requiredNumber; i++) {
                    addButton($container, i.toString());
                }

            });
        });
    </script>
        
    <a href="#" id="startBtn">Start creation!</a>
    <div id="container"></div>
    
</body>
</html>
